package com.tjsinfo.tjsoa.worklog.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.tjsinfo.tjsoa.system.vo.User;
import com.tjsinfo.tjsoa.worklog.bo.IWorkLogMainBo;
import com.tjsinfo.tjsoa.worklog.vo.WorkLogMain;


public class SelectWorkLogAction extends Action{
private IWorkLogMainBo workLogMainBo;
	
	
public IWorkLogMainBo getWorkLogMainBo() {
	return workLogMainBo;
}


public void setWorkLogMainBo(IWorkLogMainBo workLogMainBo) {
	this.workLogMainBo = workLogMainBo;
}


	/* (non-Javadoc)
	 * @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
	 */
	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		// TODO Auto-generated method stub
		
		HttpSession session = request.getSession();
		String id = request.getParameter("id");
		User user = (User) session.getAttribute("user");
		String jihuaid = request.getParameter("id");
		WorkLogMain   workLogMain =  workLogMainBo.selectWorkLogMainAndExamine(id);
		Integer messageid = 0;
		if(request.getParameter("messageid") == null)
		{
		
			//tjsMessageBo.deletetjsmessagebyid("工作日志 ", workLogMain.getId(),user.getUser_id());
		}
		else
		{
			
		}
		request.setAttribute("plan", workLogMain);
		request.setAttribute("messageid", messageid);
		return mapping.findForward("ok");
	}
	
}
